package com.shinechain.twitter;

import twitter4j.IDs;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.User;
import twitter4j.auth.RequestToken;

import javax.net.ssl.SSLSession;

public class GetUser {
    public static void main(String[] args) throws TwitterException {
        System.setProperty("proxySet", "true");
        System.setProperty("http.proxyHost", "127.0.0.1");
        System.setProperty("http.proxyPort", "1080");
        javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(new javax.net.ssl.HostnameVerifier()
        {
            public boolean verify(String hostname,
                                  SSLSession sslsession) {
                return true;
            }
        });
        GetConfiguration conf = new GetConfiguration();
        Twitter twitter = conf.getNewInstance();
        /*RequestToken requestToken = null;
        try {
            requestToken = twitter.getOAuthRequestToken();

            String token = requestToken.getToken();
            String tokenSecret = requestToken.getTokenSecret();
            System.out.println(token);
            System.out.println(tokenSecret);
        } catch (TwitterException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
*/
        User user = twitter.showUser("TankDog9");
        System.out.println(user.getId());
        IDs followersIDs = twitter.getFollowersIDs(user.getId());
        System.out.println(followersIDs.getIDs().length);
    }






}
